package com.itheima.aspact;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Slf4j
//@Aspect
//@Component
public class MyAdvice {
    @Pointcut("execution(* com.itheima.service.impl.*.save(..))")
    public void abc(){

    }
    @Before("abc()")
    public void before(JoinPoint joinPoint){
        log.info("---------011111111.");
    }
    @After("abc()")
    public void After(JoinPoint joinPoint){
        log.info("---------------22222222.");
    }
    @AfterReturning("abc()")
    public void AfterReturning(JoinPoint joinPoint){
        log.info("-------------------33333333.");
    }
    @AfterThrowing("abc()")
    public void AfterThrowing(JoinPoint joinPoint){
        log.info("44444444.");
    }
}
